Process External Links for Knowledge Base
Used to accept URLs or links to external content, which will then be crawled, processed, and indexed into the knowledge base. This allows the AI to draw information from web pages or online resources.
API Endpoint
| Property | Value |
|---|---|
| Request Method | POST |
| Request URL | https://api.seliseblocks.com/kb/link |
Request
Request Example
curl -X POST 'https://api.seliseblocks.com/kb/link' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"project_key": "YOUR_PROJECT_KEY",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"link": "https://example.com/documentation/getting-started",
"allow_recursive": true
}'
Request Headers
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
| Content-Type | application/json | Yes | Data type, must be application/json. |
Request Body
Request Body Schema
{
"project_key": "string",
"agent_id": "string",
"link": "string",
"allow_recursive": false
}
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| project_key | string | Yes | The project key for your project. |
| agent_id | string | Yes | UUID of the AI agent to associate the content with. |
| link | string | Yes | Valid URL of the external content to crawl and process. |
| allow_recursive | boolean | No | Whether to recursively crawl linked pages from the provided URL. Default: false. |
note
Recursive Crawling
- When
allow_recursiveis set totrue, the system will follow links on the provided page and crawl related content within the same domain. - Be cautious with recursive crawling on large websites, as it may take considerable time and resources to process.
tip
External links are useful for:
- Ingesting product documentation from your website
- Adding knowledge from blog posts or articles
- Incorporating information from public knowledge bases
- Keeping your agent updated with the latest web content
Response
Success Response (200 OK)
Returns an object containing the processing status.
{
"is_success": true,
"detail": "Link content crawled and added to knowledge base successfully",
"error": {}
}
Response Fields
| Field | Type | Description |
|---|---|---|
| is_success | boolean | Indicates whether the link processing was successful. |
| detail | string | Success or failure message with additional context. |
| error | object | Error details if the operation failed (empty if successful). |
warning
The crawling and processing of external links may take time depending on:
- The size and complexity of the content
- Whether recursive crawling is enabled
- The responsiveness of the external website
- The number of pages to be processed
Error Response (422 Unprocessable Entity)
Returns validation error details when the request body is invalid.
{
"detail": [
{
"loc": [
"body",
"link"
],
"msg": "invalid or missing URL scheme",
"type": "value_error.url.scheme"
}
]
}
Error Response Fields
| Field | Type | Description |
|---|---|---|
| detail | array | Array of validation error objects. |
| loc | array | Location of the error in the request (e.g., body field). |
| msg | string | Human-readable error message. |
| type | string | Error type identifier. |
Error Codes
| Status Code | Description | Response Type |
|---|---|---|
| 200 | Successful Response | Success |
| 400 | Bad Request - Invalid URL or crawling error | Bad Request |
| 422 | Validation Error - Invalid request parameters | Unprocessable Entity |
| 504 | Gateway Timeout - External site not responding | Gateway Timeout |